#ifndef GSPLOTSETTINGDIALOG_H
#define GSPLOTSETTINGDIALOG_H

#include <QDialog>
#include <QFont>

#include "gsplot.h"

namespace Ui {
class GSPlotSettingDialog;
}

class GSPlotSettingDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit GSPlotSettingDialog(GSPlot* gsplot, QWidget *parent = 0);
    ~GSPlotSettingDialog();
    GSPlotPara getParameters();
    void updataDialog(GSPlotPara para);
    QFont getFont(QFont font);
    QColor getColor(QColor color);

private slots:
    void restoreParameters();

    //Label
    void titleChange();
    void gridVisiableChange();
    void axisLabelChange();
    void axisSelectChange(int index);

    //Size
    void plotWidthChange(int value);
    void plotHeightChange(int value);
    void lockedRatioChange();
    void resolutionChange(int dpi);
    void autoScaleChange();

    //Font
    void setFont(); //from palette
    void fontSizeChange(int size);
    void setFontColor();//from font dialog

    //Line
    void lineSelectChange(int index);
    void lineStyleChange(int index);
    void lineColorChange(int index);//predefine corlor select
    void setLineColor();//from palette
    void lineWidthChange(int value);

    //Mark
    void markSelectChange(int index);
    void markStyleChange(int index);
    void markColorChange(int index);//predefine corlor select
    void markSizeChange(int value);
    void setMarkColor();//from palette
    void showDataChange(int num);//Points for diaplay
    
    //Legend
    void legendVisiableChange();
    void legendLabelChange();
    void legnedItemSelectChange(int index);

private:
    Ui::GSPlotSettingDialog *ui;

    //General Plot Parameters
    GSPlotPara parameters;
    GSPlotPara parametersBack;

    GSPlot* inPlot;
};

#endif // GSPLOTSETTINGDIALOG_H
